package modules.componentpanel.htmlcomponents
{
	import spark.components.Button;

	public class HTMLButton extends Button implements HTMLDataInterface
	{

		private var _data:Object;

		public function get data():Object
		{
			if (_data == null)
			{
				_data=new Object();
				_data.name=GlobalConfig.ICON_BUTTON_BUTTON;
				_data.label=GlobalConfig.ICON_BUTTON_BUTTON;
			}
			return this._data;
		}

		public function set data(newData:Object):void
		{
			this._data=newData;
			//update visible content with data
			if (newData)
			{
				this.label=newData.label;
				if (newData.x != null)
				{
					this.x=newData.x;
				}
				if (newData.y != null)
				{
					this.y=newData.y;
				}
			}
		}

		public function HTMLButton()
		{
			super();
			this.label="Button";
		}

	}
}
